package com.zzyl.nursing.member.controller;

import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.member.dto.MemberProjectDto;
import com.zzyl.nursing.member.service.MemberProjectService;
import com.zzyl.nursing.member.vo.MemberProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/member/orders/project")
public class MemberProjectController {

    @Autowired
    private MemberProjectService memberProjectService;

    @GetMapping("/page")
    public AjaxResult page(MemberProjectDto dto) {
        MemberProjectVo vo = memberProjectService.page(dto);
        return AjaxResult.success().put("rows", vo.getRows()).put("total", vo.getTotal());
    }

    @GetMapping("/{id}")
    public R<NursingProject> select(@PathVariable Integer id) {
        return R.ok(memberProjectService.select(id));
    }
}
